var DatetimePicker={
    beginEndConstraint:function($begin,$end){
        $begin.datetimepicker('setOptions',{
            onShow:function(date, $ele, $event){
                if($end.val()=='')
                    $begin.datetimepicker('setOptions',{maxDate:false});
            },
            onSelectDate: function (date, $ele, $event) {
                $end.datetimepicker('setOptions',{minDate:date});
            },
            onSelectTime: function (date, $ele, $event) {
                $end.datetimepicker('setOptions',{minDate:date});
            }
        });
        $end.datetimepicker('setOptions',{
            onShow:function(date, $ele, $event){
                if($begin.val()=='')
                    $end.datetimepicker('setOptions',{minDate:false});
            },
            onSelectDate: function (date, $ele, $event) {
                $begin.datetimepicker('setOptions',{maxDate:date});
            },
            onSelectTime: function (date, $ele, $event) {
                $begin.datetimepicker('setOptions',{maxDate:date});
            }
        });
    }
};